#include <BMCertificado.h>
#include <QtCore/qstring.h>
#include <time.h>

string getRandomCertificado(char * semilla )
{
	string numsArray = "0123456789";
	string code = "";
	QString qstrSemilla(semilla);
	qstrSemilla.remove(0,10);
	unsigned long int granSemilla = qstrSemilla.toLong();
	srand( (unsigned int) granSemilla );
	for (int i = 0 ; i < 16 ; i++ )
	{
		code.append( 1 , numsArray[rand()%10] );
		if ( i%5 == 0 && i != 0)
			code.insert( i-1 , " " );
	}
	return code;
}

string getRandomIdTransaction()
{
	string numsArray = "0123456789";
	string code = "";
	
	srand( time(NULL) );
	for (int i = 0 ; i < 18 ; i++ )
	{
		code.append( 1 , numsArray[rand()%10] );
	}
	return code;
}